package com.clotingshoppos.modules.product.repository;

import com.clotingshoppos.common.base.BaseRepository.BaseRepository;
import com.clotingshoppos.modules.product.entity.ProductEntity;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @InterfaceName: ProductRepository
 * @Description: 产品的数据库接口
 * @Author: zhandad
 * @Date: 2019-03-14 22:39
 * @Version
 */
@Repository
public interface ProductRepository extends BaseRepository<ProductEntity> {
    List<ProductEntity> findByType(String type);
    Optional<ProductEntity> findById(String id);
    List<ProductEntity> findBySex(String sex);
    List<ProductEntity> findByName(String name);
    List<ProductEntity> findByNameAndSize(String name, String size);
    List<ProductEntity> findByNameAndColor(String name, String color);
    ProductEntity findByNameAndSizeAndColor(String name, String size, String color);
    ProductEntity save(ProductEntity productEntity);
}
